//
//  ViewController.m
//  XKObjPageView
//
//  Created by 徐凯 on 2017/6/15.
//  Copyright © 2017年 XK. All rights reserved.
//

#import "ViewController.h"

#import "XKPageView.h"


#define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]

#define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    NSArray *titles = @[@"推荐", @"手游玩法大全", @"娱乐手", @"游戏游戏", @"趣玩", @"游戏游戏", @"趣玩"];
    NSMutableArray *childVCs = [NSMutableArray array];
    for (NSString *str in titles) {
        UIViewController *vc = [[UIViewController alloc] init];
        vc.view.backgroundColor = randomColor;
        [childVCs addObject:vc];
    }
    
    XKPageStyle *style = [[XKPageStyle alloc] init];
    style.isShoeBottomLine = YES;
    XKPageView *pageView = [[XKPageView alloc] initWithFrame:self.view.bounds titles:titles childVCs:childVCs style:style parentVc:self];
    [self.view addSubview:pageView];
}


@end
